package com.yatush.prepare.jsp;

import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import com.yatush.prepare.jsp.markers.BodyAble;
import com.yatush.prepare.jsp.markers.FormAble;

public class JspForm implements BodyAble{

	private Element form;
	
	public JspForm(String commandName) {
		form = DocumentHelper.createElement("form:form");
		form.addAttribute("method","post");
		form.addAttribute("commandName",commandName);
	}
	
	public void add(FormAble newElement){
		form.add(newElement.getDomElement());
	}
	
	@Override
	public Element getDomElement() {
		return form;
	}
	
	
}
